<template>
	<view class="content">
		<div class="mine">
			<image src="/static/images/mine1.jpg" mode="aspectFill" class="bg"></image>
			<view class="user">
				<image :src="userInfo.avatar" mode="aspectFill"></image>
				<div class="r">
					<h3 class="name">{{userInfo.name}}
					</h3>
					<p class="type">{{roleTpye[userInfo.role]}}</p>
				</div>
			</view>
		</div>

		<view class="main">
			<view class="mine-list">
				<navigator url="/pages/pickup/pickup" class="items">
					<div class="l">
						<image src="../../static/icon/icon7.png" mode="widthFix"></image>
						提货申请
					</div>
					<div class="r">
						<image src="../../static/images/jt.png" mode="widthFix"></image>
					</div>
				</navigator>
				
				<navigator url="/pages/pickup/list" class="items">
					<div class="l">
						<image src="../../static/icon/icon3.png" mode="widthFix"></image>
						提货申请列表
					</div>
					<div class="r">
						<image src="../../static/images/jt.png" mode="widthFix"></image>
					</div>
				</navigator>
				<navigator url="/pages/loginTIme/loginTIme" class="items" v-if="userInfo.role*1<=2">
					<div class="l">
						<image src="../../static/icon/icon15.png" mode="widthFix"></image>
						设置登录时间
					</div>
					<div class="r">
						<image src="../../static/images/jt.png" mode="widthFix"></image>
					</div>
				</navigator>
				<navigator url="/pages/bankCard/list" class="items">
					<div class="l">
						<image src="../../static/icon/icon15.png" mode="widthFix"></image>
						银行卡
					</div>
					<div class="r">
						<image src="../../static/images/jt.png" mode="widthFix"></image>
					</div>
				</navigator>
				<navigator url="/pages/score/score" class="items">
					<div class="l">
						<image src="../../static/icon/icon15.png" mode="widthFix"></image>
						佣金
					</div>
					<div class="r">
						<image src="../../static/images/jt.png" mode="widthFix"></image>
					</div>
				</navigator>
				<navigator url="/pages/form/form" class="items">
					<div class="l">
						<image src="../../static/icon/icon15.png" mode="widthFix"></image>
						推荐官
					</div>
					<div class="r">
						<image src="../../static/images/jt.png" mode="widthFix"></image>
					</div>
				</navigator>
				<navigator url="/pages/fankui/fankui" class="items">
					<div class="l">
						<image src="../../static/icon/icon15.png" mode="widthFix"></image>
						反馈
					</div>
					<div class="r">
						<image src="../../static/images/jt.png" mode="widthFix"></image>
					</div>
				</navigator>
			</view>
		</view>

	</view>
</template>

<script>
	import {
		request
	} from '@/utils/request.js'
	export default {
		data() {
			return {
				roleTpye:{1:'超管',2:'管理员',3:'经销商',4:'用户'},
				userInfo: {}
			}
		},
		onLoad() {
		},
		onShow() {
			console.log(uni.getStorageSync('userInfo'))
			if (uni.getStorageSync('userInfo')) {
				this.userInfo = uni.getStorageSync('userInfo')
			}else{
				uni.navigateTo({
					url:"/pages/login/login"
				})
			}
		},
		methods: {
			sub(){
				request({
					url: 'index/approval-sub',
					method: 'post',
					data:{
						num:'',
						discription:'',
						name:'',
						tel:'',
						address:'',
						id:'',
						gid:'',
					}
					// data: { username:this.username,password:this.password,openid:uni.getStorageSync("openid")}
				}).then(res => {
					if (res.status == 200) {
						console.log(res.data)
						
					} else {
						uni.showToast({
							title: res.message,
							icon: 'none',
							duration: 2000
						});
					}
				}).catch((err) => {
					uni.showToast({
						title: err.message,
						icon: 'none',
						duration: 2000
					});
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #f5f5f5;
		/* 灰色背景 */
		min-height: 100vh;
		/* 确保高度占满屏幕 */
	}

	.mine {
		height: 294rpx;
		position: relative;
		width: 100%;
		overflow: hidden;

		.bg {
			position: absolute;
			left: 0;
			top: 0;
			height: 294rpx;
			width: 100%;
			z-index: 1;
		}

		color: #fff;
		font-size: 36rpx;

		.type {
			background: #ffe7d2;
			font-size: 22rpx;
			width: 120rpx;
			text-align: center;
			color: #ae816e;
			border-radius: 16rpx;
			height: 32rpx;
			line-height: 32rpx;
			margin-top: 15rpx;
		}

		.user {
			position: absolute;
			z-index: 2;
			width: 100%;
			height: 100%;
			display: flex;
			align-items: center;
			padding: 0 50rpx;

			h3 {
				display: flex;
				align-items: center;
			}

			.jifen {}

			.yue,
			.jifen {
				text-shadow: 0 0 #4a90e2;
				font-size: 28rpx;
				display: flex;
				margin-left: 10rpx;

				p {
					width: 100rpx;
					height: 40rpx;
					line-height: 40rpx;
					text-align: center;
					border-radius: 5rpx;
					margin-left: 5rpx;
					text-shadow: none;
					font-size: 22rpx;
					background-color: #fff;
					color: #4a90e2;
				}
			}

			image {
				width: 112rpx;
				height: 112rpx;
				border-radius: 100%;
				margin-right: 30rpx;
			}
		}
	}

	.main {
		padding: 30rpx;


	}

	.mine-order {
		background-color: #fff;
		border-radius: 10rpx;
		padding: 20rpx;
		padding-bottom: 40rpx;

		.t {
			display: flex;
			align-items: center;
			justify-content: space-between;
			font-size: 28rpx;
			color: #000;
			margin-bottom: 40rpx;

			.more {
				color: #666;
				font-size: 24rpx;
			}
		}

		.list {
			display: flex;

			.items {
				width: 25%;
				text-align: center;
				font-size: 24rpx;
				color: #333;

				p {
					margin-top: 15rpx;
				}

				image {
					display: block;
					width: 50rpx;
					margin: 0 auto;
				}
			}
		}
	}

	.mine-tgy {
		background-color: #fff;
		border-radius: 10rpx;
		padding: 20rpx;
		padding-bottom: 40rpx;
		margin-top: 30rpx;

		.t {
			display: flex;
			align-items: center;
			justify-content: space-between;
			font-size: 28rpx;
			color: #000;
			margin-bottom: 40rpx;

			.more {
				color: #666;
				font-size: 24rpx;
			}
		}

		.list {
			display: flex;

			.items {
				width: 33.3%;
				text-align: center;

				h3 {
					font-size: 32rpx;
					font-weight: bold;
					margin-bottom: 20rpx;
				}

				p {
					font-size: 24rpx;
				}
			}
		}
	}

	.mine-list {
		background-color: #fff;
		margin-top: 30rpx;
		border-radius: 10rpx;
		padding: 0 20rpx;

		.items {
			display: flex;
			justify-content: space-between;
			align-items: center;
			height: 100rpx;
			border-bottom: 1px solid #eeeef3;

			&:last-child {
				border: none;
			}

			.l {
				display: flex;
				align-items: center;
				font-size: #333;
				font-size: 28rpx;

				image {
					width: 40rpx;
					display: block;
					margin-right: 20rpx;
				}
			}

			.r {
				image {
					display: block;
					width: 40rpx;
					    transform: rotate(-90deg);
				}
			}
		}
	}
</style>